package juc.threadLocal;

/**
 * @author liwuji
 * @date 2024/1/23
 * @desc
 **/
public class House {
    int saleCount = 0;
//    ThreadLocal<Integer> integerThreadLocal = new ThreadLocal<Integer>(){
//        @Override
//        protected Integer initialValue() {
//            return 0;
//        }
//    };
ThreadLocal<Integer> saleVulome = ThreadLocal.withInitial(()->0);
    public synchronized void saleHouse(){
        this.saleCount++;
    }
    public  void saleVulome(){
        this.saleVulome.set(saleVulome.get()+1);
    }
}
